<%-------------------------------------------------------------------
 * 页面名称：batchAuditRejectManage.jsp
 * 功能描述：批量交易录入页面
 * Action: 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ipb" uri="/WEB-INF/conf/tld/ipb.tld"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
String path = request.getContextPath();
%>
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/newstyle.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/common.css" rel="stylesheet" type="text/css" />
<Style>
<!--
.box {width:100%;margin:auto;}
.off {margin-left:3px;line-height:34px;float:left;width:93px;height:34px;color:#0099CC;font-size:14px;font-weight:bold;text-align:center;background-color:#DCDEDD;cursor: hand;}
.on {margin-left:3px;line-height:34px;float:left;width:93px;height:34px;color:#0099CC;font-size:14px;font-weight:bold;text-align:center;border-top: 1px #CCCCCC solid;border-left:1px #CCCCCC solid;border-right: 1px #CCCCCC solid;cursor: hand;}
-->
</style>
<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/accountTemplate.js'></script>
<script type='text/javascript' src='<%=path%>/js/vnv/commonForManage.js'></script>
<script language=javascript src="<%=path%>/js/popcalendar.js"></script>
<script language="JavaScript" type="text/JavaScript">

function validate(){
    var amountMin = document.forms[0].amountMin;
    var amountMax = document.forms[0].amountMax;
    if(parseFloat(amountMin.value)>parseFloat(amountMax.value)){
        alert("您输入的最小金额大于最大金额！");
        return false;
    }
    if(isNaN(amountMin.value)){
        alert('您输入的最小金额不正确，请重新输入');
        amountMin.value = "";
        amountMin.focus();
        return false;
    }
    if(isNaN(amountMax.value)){
        alert('您输入的最大金额不正确，请重新输入');
        amountMax.value = "";
        amountMax.focus();
        return false;
    }
    return true;
}
function doSubmit(){
    if(validate()){
        document.forms[0].submit();
    }
}
function getActionByTransStatus(transStatus){
    var action = "toWaitPay";
    if(transStatus=="1"){
        action = "waitingAuditList";
    }else if(transStatus=="2"){
        action = "waitingPayList";
    }else if(transStatus=="4"){
        action = "auditRejectList";
    }
    return "<%=path%>/page/transaction/"+action+".do";
}
function changeBatchType(batchType){
    if(validate()){
        var transStatus = document.forms[0].transStatus.value;
        document.forms[0].action = getActionByTransStatus(transStatus);
        document.getElementById('batchType').value=batchType;
        document.forms[0].submit();
    }
}
var globalBatchNo;
function peerAccountView(batchNo){
    globalBatchNo = batchNo;
    agiledata.getUserInternal(peerAccountPopup);
}
function peerAccountPopup(data){
    if(data) {
        openLayer("<%=path%>/page/transaction/viewEsBatchTransPeerAccount.do?batchNo="+globalBatchNo);
    } else {
        location.href="<%=path%>/page/util/session_invalid.jsp";
    }
}
function batchAudit(){
    document.getElementById('transStatus').value = '4';
    document.forms[0].batchType.value=true;
    document.forms[0].action="<%=path%>/page/transaction/toWaitPay.do";
    document.forms[0].submit();
    
}
function id_keyup(txtinput){
    txtinput.value=txtinput.value.replace(/(^\s*)|(\s*$)/g, "");
}
</script>
<div id="main">
	<div class="content_right">
		<div style="width:745px;margin-left:10px;">
			<div class="titleinfo">
				<ad:TypeChange typeId="ES_PRE_PAY_TRANS_STATUS">
					<bean:write name="transStatus" />
				</ad:TypeChange>
				批量交易
			</div>
			<div class="tab">
				<div class="off" onClick="changeBatchType(false)">
					单笔交易
				</div>
				<div class="on">
					批量交易
				</div>
				<div class="drop_bg"></div>
				<div style="clear:both;"></div>
				<div class="edit_pass">
					<html:form action="auditRejectQuery">
						<html:hidden property="transStatus" />
						<html:hidden property="batchType" />
						<input type="hidden" name="batchNumber" />
						<table width="100%" border="0" align="center" cellpadding="3"
							cellspacing="1">
							<tr>
								<td align="right" bgcolor="#FFFFFF">
									批次号：
									<br />
								</td>
								<td bgcolor="#FFFFFF">
									<html:text styleClass="inputStyle" property="batchNo" size="15"
										onblur="id_keyup(this);" />
								</td>
								<td align="right" bgcolor="#FFFFFF">
									交易金额：
								</td>
								<td bgcolor="#FFFFFF">
									<span class="qzt"><html:text styleClass="inputStyle"
											size="10" property="amountMin" onkeyup="id_keyup(this)" />
									</span> 至
									<span class="qzt"><html:text styleClass="inputStyle"
											size="10" property="amountMax" onkeyup="id_keyup(this)" />
									</span>
								</td>
							</tr>
							<tr>
								<td width="18%" align="right" bgcolor="#FFFFFF">
									请选择交易类型：
								</td>
								<td width="30%" bgcolor="#FFFFFF">
									<div class="select">
										<div>
											<html:select property="actionTypeID">
												<html:option value="">全部</html:option>
												<html:optionsCollection name="actionTypeList"
													label="actionName" value="id" />
											</html:select>
										</div>
									</div>
								</td>
								<td align="right" bgcolor="#FFFFFF">
									交易日期：
								</td>
								<td bgcolor="#FFFFFF">
									<span class="qzt"> <span class="qzt"><ad:calendar
												property="strBeginDate" path="<%=path%>" />
									</span> 至 <span class="qzt"><ad:calendar property="strEndDate"
												path="<%=path%>" />
									</span> </span>
								</td>
							</tr>
							<tr>
								<td align="right" bgcolor="#FFFFFF">
									子账户：
								</td>
								<td bgcolor="#FFFFFF">
									<div class="select">
										<div>
											<html:select property="actionTypeID">
												<html:option value="">所有账户</html:option>
												<html:optionsCollection name="subList" label="accountName"
													value="id" />
											</html:select>
										</div>
									</div>
								</td>
								<td align="right" bgcolor="#FFFFFF">
									交易笔数
								</td>
								<td bgcolor="#FFFFFF">
									<span class="qzt"><html:text styleClass="inputStyle"
											size="10" property="beginCount" onkeyup="id_keyup(this)" />
									</span> 至
									<span class="qzt"><html:text styleClass="inputStyle"
											size="10" property="endCount" onkeyup="id_keyup(this)" />
									</span>
								</td>
							</tr>
							<tr>
								<td colspan="4" align="right" bgcolor="#FFFFFF">
									<hr size="1" style="color:#88A7C0;" />
								</td>
							</tr>
							<tr>
								<td colspan="4" align="center" bgcolor="#FFFFFF">
									<span class="button_Frame"> <input name="button"
											type="button" class="graybutton_style" onclick="doSubmit()"
											value="查 询" /> </span>
								</td>
							</tr>
						</table>
						<br />
						<table width="100%" class="tablestyle">
							<tr>
								<th>
									<span class="blue14">批次号</span>
								</th>
								<th>
									<span class="blue14">交易子账户</span>
								</th>
								<th>
									<span class="blue14">交易对方</span>
								</th>
								<th>
									<span class="blue14">交易类型</span>
								</th>
								<th>
									<span class="blue14">交易时间</span>
								</th>
								<th>
									<span class="blue14">总笔数/拒绝笔数</span>
								</th>
								<th>
									<span class="blue14">总金额</span>
								</th>
								<th>
									<span class="blue14">操作</span>
								</th>
							</tr>
							<c:forEach var="id" items="${waitPayList.data}"
								varStatus="status">
								<tr>
									<td>
										<bean:write name="id" property="batchNo" />
									</td>
									<td>
										<bean:write name="id" property="debit.accountName" />
									</td>
									<td>
										<a class="menuTextBlue" href="#"
											onclick="peerAccountView('<bean:write name="id" property="batchNo" />')">查看</a>
									</td>
									<td>
										<bean:write name="id" property="actionType.actionName" />
									</td>
									<td>
										<bean:write name="id" property="beginDate"
											format="yyyy-MM-dd HH:mm" />
									</td>
									<td>
										<bean:write name="id" property="totalCount" />
										/
										<bean:write name="id" property="rejectCount" />
									</td>
									<td>
										<bean:write name="id" property="totalAmountWithFee"
											format="#0.00" />
									</td>
									<td>
										<a class="menuTextBlue" href="#"
											onclick="document.getElementById('batchNumber').value='<bean:write name="id" property="batchNo"/>';batchAudit()">操作</a>
									</td>
								</tr>
							</c:forEach>
						</table>
						<table width="100%" height="30" border="0" cellpadding="0"
							cellspacing="0">
							<tr>
								<td height="25" align="center" class="font_blue">
									<ad:PageBean name="waitPayList" />
								</td>
							</tr>
						</table>
					</html:form>
				</div>
			</div>
		</div>
	</div>